package gitee

import "time"

type MergeRequest struct {
	ID                int64            `json:"id"`
	URL               string           `json:"url"`
	HtmlURL           string           `json:"html_url"`
	DiffURL           string           `json:"diff_url"`
	PatchURL          string           `json:"patch_url"`
	IssueURL          string           `json:"issue_url"`
	CommitsURL        string           `json:"commits_url"`
	ReviewCommentsURL string           `json:"review_comments_url"`
	ReviewCommentURL  string           `json:"review_comment_url"`
	CommentsURL       string           `json:"comments_url"`
	Number            int64            `json:"number"`
	State             string           `json:"state"`
	AssigneesNumber   int64            `json:"assignees_number"`
	TestersNumber     int64            `json:"testers_number"`
	Assignees         []Assignees      `json:"assignees"`
	Testers           []Testers        `json:"testers"`
	Milestone         MileStone        `json:"milestone"`
	Labels            []Label          `json:"labels"`
	Locked            bool             `json:"locked"`
	CreatedAt         time.Time        `json:"created_at"`
	UpdatedAt         time.Time        `json:"updated_at"`
	ClosedAt          time.Time        `json:"closed_at"`
	Draft             bool             `json:"draft"`
	MergedAt          time.Time        `json:"merged_at"`
	Mergeable         bool             `json:"mergeable"`
	CanMergeCheck     bool             `json:"can_merge_check"`
	Links             Links            `json:"_links"`
	User              User             `json:"user"`
	RefPullRequests   []RefPullRequest `json:"ref_pull_requests"`
	Title             string           `json:"title"`
	Body              string           `json:"body"`
	Head              Head             `json:"head"`
	Base              Base             `json:"base"`
}

type Label struct {
	Id           int64     `json:"id"`
	Color        string    `json:"color"`
	Name         string    `json:"name"`
	RepositoryId int64     `json:"repository_id"`
	Url          string    `json:"url"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type RefPullRequest struct {
	Number string `json:"number"`
	Title  string `json:"title"`
	State  string `json:"state"`
}

type Assignees struct {
	ID                int64  `json:"id"`
	Login             string `json:"login"`
	Name              string `json:"name"`
	AvatarURL         string `json:"avatar_url"`
	URL               string `json:"url"`
	HtmlURL           string `json:"html_url"`
	Remark            string `json:"remark"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
	Assignee          bool   `json:"assignee"`
	CodeOwner         bool   `json:"code_owner"`
	Accept            bool   `json:"accept"`
}

type Testers struct {
	ID                int64  `json:"id"`
	Login             string `json:"login"`
	Name              string `json:"name"`
	AvatarURL         string `json:"avatar_url"`
	URL               string `json:"url"`
	HtmlURL           string `json:"html_url"`
	Remark            string `json:"remark"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
	Assignee          bool   `json:"assignee"`
	CodeOwner         bool   `json:"code_owner"`
	Accept            bool   `json:"accept"`
}

type Self struct {
	Href string `json:"href"`
}

type Html struct {
	Href string `json:"href"`
}

type MergeRequestIssue struct {
	Href string `json:"href"`
}

type Comments struct {
	Href string `json:"href"`
}

type ReviewComments struct {
	Href string `json:"href"`
}

type ReviewComment struct {
	Href string `json:"href"`
}

type Commits struct {
	Href string `json:"href"`
}

type Links struct {
	Self           Self              `json:"self"`
	Html           Html              `json:"html"`
	Issue          MergeRequestIssue `json:"issue"`
	Comments       Comments          `json:"comments"`
	ReviewComments ReviewComments    `json:"review_comments"`
	ReviewComment  ReviewComment     `json:"review_comment"`
	Commits        Commits           `json:"commits"`
}

type Repo struct {
	ID          int64     `json:"id"`
	FullName    string    `json:"full_name"`
	HumanName   string    `json:"human_name"`
	URL         string    `json:"url"`
	Namespace   Namespace `json:"namespace"`
	Path        string    `json:"path"`
	Name        string    `json:"name"`
	Owner       User      `json:"owner"`
	Assigner    User      `json:"assigner"`
	Description string    `json:"description"`
	Private     bool      `json:"private"`
	Public      bool      `json:"public"`
	Internal    bool      `json:"internal"`
	Fork        bool      `json:"fork"`
	HtmlUrl     string    `json:"html_url"`
	SshUrl      string    `json:"ssh_url"`
}

type Head struct {
	Label string `json:"label"`
	Ref   string `json:"ref"`
	Sha   string `json:"sha"`
	User  User   `json:"user"`
	Repo  Repo   `json:"repo"`
}

type Base struct {
	Label string `json:"label"`
	Ref   string `json:"ref"`
	Sha   string `json:"sha"`
	User  User   `json:"user"`
	Repo  Repo   `json:"repo"`
}

type MergeRequestComment struct {
	URL              string       `json:"url"`
	ID               int64        `json:"id"`
	Path             string       `json:"path"`
	Position         interface{}  `json:"position"`
	OriginalPosition interface{}  `json:"original_position"`
	NewLine          int64        `json:"new_line"`
	CommitID         interface{}  `json:"commit_id"`
	OriginalCommitID interface{}  `json:"original_commit_id"`
	User             User         `json:"user"`
	CreatedAt        time.Time    `json:"created_at"`
	UpdatedAt        time.Time    `json:"updated_at"`
	Body             string       `json:"body"`
	HtmlUrl          string       `json:"html_url"`
	PullRequestURL   string       `json:"pull_request_url"`
	Links            CommentLinks `json:"_links"`
	CommentType      string       `json:"comment_type"`
	InReplyToID      int64        `json:"in_reply_to_id,omitempty"`
}

type PullRequest struct {
	Href string `json:"href"`
}

type CommentLinks struct {
	Self        Self        `json:"self"`
	HTML        Html        `json:"html"`
	PullRequest PullRequest `json:"pull_request"`
}
